1. Field of the Invention
The present invention relates to integrated circuit designs; and, in particular, the present invention relates to integrated circuit designs for image processing.
2. Discussion of the Related Art
The Motion Picture Experts Group (MPEG) is an international committee charged with providing a standard for achieving compatibility between image compression and decompression equipment. Since its inception, two standards (referred hereinbelow as "MPEG-1" and "MPEG-2") have been proposed by MPEG. Each of these standards specifies both the coded digital representation of video signal for the storage media, and the method for decoding. The coded digital representation supports normal speed playback, as well as other playback modes of color motion pictures, and reproduction of still pictures. Both the MPEG-1 and MPEG-2 standards cover the common 525- and 625-line television, personal computer and workstation display formats. The MPEG-1 and MPEG-2 standards are intended for equipment supporting high continuous transfer rates, such as those used in compact disks, digital audio tapes, real-time television broadcast, or magnetic hard disks. The MPEG-1 and MPEG-2 standards are intended to support variable-size picture frames of at a rate between 24 Hz and 30 Hz. A publication by MPEG entitled "Coding for Moving Pictures and Associated Audio for digital storage medium at 1.5 Mbit/s," provides in draft form the proposed MPEG-1 standard, which is hereby incorporated by reference in its entirety to provide detailed information about the MPEG-1 standard. A publication by MPEG entitled "Generic Coding of Moving Pictures and Associated Audio Information: Video," provides in draft form the proposed MPEG-2 standard, which is hereby incorporated by reference in its entirety to provide detailed information about the MPEG-2 standard.
Under either the MPEG-1 or the MPEG-2 standard, a picture is divided into a matrix of "Macroblock slices" (MBS), each MBS containing a number of picture areas (called "macroblocks"). Each picture area covers an area of 16.times.16 pixels and is further represented by one or more 8.times.8 matrices whose elements are the spatial luminance and chrominance values. In one representation (4:2:2) of the macroblock, the 16.times.16 pixel area is represented by a 16.times.16 matrix of luminance values (Y type) and two 8.times.8 matrices of each of two chrominance values (U and V types, representing respectively blue and red chrominance). That is, the U or V matrices are each provided at one half the resolution of the luminance values. In another representation (4:2:0), 16.times.16 luminance values in four 8.times.8 matrices are provided for the 16.times.16 pixels picture area, and two 8.times.8 matrices, one for each of the U and V pixel types, are provided to represent the chrominance values of the 16.times.16-pixel picture area.
In the discussion below, a group of four contiguous pixels in a 2.times.2 configuration is called a "quad pixel"; hence, the macroblock can also be thought of as comprising 64 quad pixels in an 8.times.8 configuration. Four quad pels in a 2.times.2 configuration form a "tile".
The MPEG-1 and MPEG-2 standards both adopt video data compression and decompression models based on lossy compression of both interframe and intraframe information. To compress interframe information, each frame is encoded in one of the following formats: "intra", "predicted", or "interpolated". "Intra-coded" frames ("intra frames" or "I-pictures") are least frequently provided in the compressed data, the predicted frames ("P-pictures") are provided more frequently than the intra frames, and all the remaining frames are interpolated frames. In a P-picture, only the incremental changes in pixel values from the last I-picture or P-picture are coded. In an interpolation frame ("B-picture"), the pixel values are encoded with respect to both an earlier frame and a later frame. By encoding frames incrementally, using predicted and interpolated frames, redundant information between frames can be eliminated, resulting in a highly efficient data storage scheme. Under either MPEG-1 or MPEG-2, the motion of an object moving from one screen position to another screen position can be represented by motion vectors. A motion vector is a "shorthand" representation for encoding a spatial translation of a group of pixels, typically a macroblock.
The next steps in compression under either the MPEG-1 or the MPEG-2 standard provide lossy compression of intraframe information. In the first step, a 2-dimensional discrete cosine transform (DCT) is performed on each of the 8.times.8 pixel matrices to map the spatial luminance or chrominance values into the frequency domain.
Next, a process called "quantization" weights each element of the 8.times.8 transformed matrix, consisting of 1 "DC" value and sixty-three "AC" values, according to whether the pixel matrix is of the chrominance or the luminance type, and the frequency represented by each element of the transformed matrix. In an I-picture, the quantization weights are intended to reduce to zero many high frequency components of the image to which the human eye is not sensitive. In P-pictures and B-pictures, which contain mostly higher frequency components, the weights are not related to visual perception. Having created many zero elements in the 8.times.8 transformed matrices, each matrix can be represented without further information loss as an ordered list consisting of a "DC" value, and alternating pairs of a non-zero "AC" value and a length of zero elements following the non-zero value. Under MPEG-2, the ordered list can be prepared from one of two prescribed orders of listing the matrix elements.
Finally, an entropy encoding scheme using variable-length codes is used to further compress the representations of the DC coefficient and the AC value-run length pairs. Under the entropy encoding scheme, the more frequently occurring symbols are represented by shorter codes. Further efficiency in storage is thereby achieved.
The MPEG-1 and MPEG-2 standards differ in many respects, some of which are discussed next. First, under the MPEG-1 standard, an interlaced video sequence is encoded using the entire frame, consisting of both odd and even fields. Under MPEG-2, however, any field of a frame in a video sequence can be predicted using either a selected field or a selected frame.
Second, under the MPEG-1 standard, each DCT coefficient of a 8.times.8 luminance or chrominance matrix is coerced ("oddified") to an odd value. Under the MPEG-2 standard, however, if the cyclic redundancy checksum (CRC) of the entire 8.times.8 luminance or chrominance matrix is even, then the last DCT coefficient is oddified. Under the MPEG-1 standard, each DCT coefficient is represented by an 8-bit value. Under the MPEG-2 standard, each DCT coefficient can be represented by an 11-bit value.
The steps involved in compression under either MPEG-1 and MPEG-2 standards are computationally intensive. For such a compression scheme to be practical and widely accepted, however, a high-speed processor at an economical cost is desired. Such processor is preferably provided in an integrated circuit.
Thus, it would be desirable to provide a multistandard video encoder which can be selectably used for encoding a video sequence under either the MPEG-1 or the MPEG-2 standards. In particular, it would be beneficial to provide in such a multistandard encoder both hardware and software supports to achieve efficiency in implementing the extensions in MPEG-2 of MPEG-1 features.